import request from '@/config/axios'

// 员工 VO
export interface EmployeeVO {
  id: string // 主键
  address: string // 家庭住址
  createAt: string // 创建时间
  department: string // 所在部门
  gender: string // 性别
  idCard: string // 身份证
  name: string // 姓名
  phone: string // 联系电话
  updateAt: string // 更新时间
}

// 员工 API
export const EmployeeApi = {
  // 查询员工分页
  getEmployeePage: async (params: any) => {
    return await request.get({ url: `/wms/employee/page`, params })
  },

  // 查询员工详情
  getEmployee: async (id: string) => {
    return await request.get({ url: `/wms/employee/get?id=` + id })
  },

  // 新增员工
  createEmployee: async (data: EmployeeVO) => {
    return await request.post({ url: `/wms/employee/create`, data })
  },

  // 修改员工
  updateEmployee: async (data: EmployeeVO) => {
    return await request.put({ url: `/wms/employee/update`, data })
  },

  // 删除员工
  deleteEmployee: async (id: string) => {
    return await request.delete({ url: `/wms/employee/delete?id=` + id })
  },

  // 导出员工 Excel
  exportEmployee: async (params) => {
    return await request.download({ url: `/wms/employee/export-excel`, params })
  },
}
